<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="css/login2.css">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <title>头部</title>
    <script type="text/javascript">
        function performSearch() {
            // 获取输入框的值
            var searchText = document.getElementById('searchText').value;
            alert(searchText);
            location.href = "${pageContext.request.contextPath}/performSearch?sText=" + searchText;
        }
    </script>
</head>
<body>

<div id="top">
    <div id="topdiv">
            <span>
                <a href="index.jsp" id="a_top" target="_blank">小米商城，欢迎你${username}~</a>
            </span>
        <span style="float:right">
           		<c:if test="${empty user}">
                    <a href="login.jsp" id="a_top">登录</a>
                    <li>|</li>
                    <a href="register.jsp" id="a_top">注册</a>
                </c:if>
       			<c:if test="${not empty user}">
                    <a href="address" id="a_top">${user.userName}</a>
                    <li>|</li>
                    <a href="logout.do" id="a_top">注销</a>
                    <li>|</li>
                    <a href="${pageContext.request.contextPath}/orderShow?statusFilter=${"all"}" id="a_top">我的订单</a>
                    <li>|</li>
                    <a href="${pageContext.request.contextPath}/address" id="a_top">地址管理</a>
                </c:if>
                <li>|</li>
                <a href="${pageContext.request.contextPath}/cartShow.do?u_id=${user.userId}" id="shorpcar">购物车</a>
            </span>
    </div>
</div>
<div id="second">
    <a href="" id="seimg" style=" margin-top:23px;"><img id="logo" src="image/logo_top.png" width="55" height="54"/></a>
    <a href="" id="seimg" style=" margin-top:17px;"><img id="gif" src="image/yyymix.gif" width="180" height="66"/></a>
    <p id="goodsType">
        <!-- 根据ajax 回调函数 填写数据 到此id中 -->

    </p>
    <form action="${pageContext.request.contextPath}/performSearch" method="post" class="form-inline pull-right"
          style="margin-top: 40px;margin-right: 10px;">

        <div class="form-group">
            <input type="text" class="form-control" name="searchText" style="width: 400px"
                   placeholder="搜索一下好东西...">
        </div>

        <button onclick="performSearch()" type="submit" class="btn btn-warning"
        ><span class="glyphicon glyphicon-search"></span>搜索
        </button>
    </form>
</div>
</body>
</html>